package com.longge.wechat.thread;


public class ThreadQues implements Runnable{
	int a = 10;
	
	public synchronized void m1() {
		a = 20;
		try {
			Thread.sleep(100);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("m1 中 a的值："+a);
	}
	
	public void m2() {
		System.out.println("m2 中 a的值："+a);
	}

	@Override
	public void run() {
		m1();
	}
	
	public static void main(String[] args) {
		ThreadQues tq = new ThreadQues();
		Thread thread = new Thread(tq);
		
		thread.start();
		try {
			Thread.sleep(100);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		tq.m2();
	}
}
